<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="服务人员额度" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="statusChange(1,1)"
                            ng-disabled="!btnPermission.serviceStaffQuotaEnable"
                            title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">批量启用</button>
                    <button class="btn btn-operate" ng-click="statusChange(1,0)"
                            ng-disabled="!btnPermission.serviceStaffQuotaEnable"
                            title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">批量禁用</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="服务人员名称" ng-model="condition.staffName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">服务人员名称：</label>
                        <input type="text" name="staffName" class="form-control col-xs-8" ng-model="condition.staffName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">状态：</label>
                        <select class="form-control" ng-model="condition.status" ng-options="item.id as item.name for item in userStatues">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll()"></div>
                                </th>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.scrollLeft"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item)"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">
                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item.staffId)"
                                                ng-disabled="!btnPermission.serviceStaffQuotaEdit" title="{{!btnPermission.serviceStaffQuotaEdit?'无权限执行此操作':''}}">设置额度</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="statusChange(0,0,item.id)"
                                                ng-disabled="item.status === 0 || !btnPermission.serviceStaffQuotaEnable"
                                                title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">禁用</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="statusChange(0,1,item.id)"
                                                ng-disabled="!!!item.id||item.status === 1 || !btnPermission.serviceStaffQuotaEnable"
                                                title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">启用</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">
                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item.staffId)"
                                                ng-disabled="!btnPermission.serviceStaffQuotaEdit" title="{{!btnPermission.serviceStaffQuotaEdit?'无权限执行此操作':''}}">设置额度</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="statusChange(0,0,item.id)"
                                                ng-disabled="item.status === 0 || !btnPermission.serviceStaffQuotaEnable"
                                                title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">禁用</button>
                                        <button class="btn btn-operate m-r-xs" ng-click="statusChange(0,1,item.id)"
                                                ng-disabled="item.id||item.status === 1 || !btnPermission.serviceStaffQuotaEnable"
                                                title="{{!btnPermission.serviceStaffQuotaEnable?'无权限执行此操作':''}}">启用</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allChecked" yb-check-name="全选" yb-click="selectAll()"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group">
                        <label class="col-xs-2 control-label">服务人员：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="loginName" class="form-control" ng-model="detailInfo.staffName"
                                    yb-focus ng-disabled="tabFlag.type === 1" maxlength="20">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-2 control-label"><i>*</i>借用额度：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="borrowingQuota" class="form-control" ng-model="detailInfo.borrowingQuota" required
                                   yb-focus  yb-number-input disable-decimal="false" decimal-places="2"
                                   max="9999999.99">
                        </div>
                        <label class="col-xs-1 control-label" style="width:25px;">元</label>
                        <div class="col-xs-4 msg-block" style="margin-left: 142px;"
                             ng-show="form.borrowingQuota.$invalid && submitted">
                            <div class="error-msg" ng-if="!form.borrowingQuota.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-2 m-b-n text-right max-w-100">已借用金额：</label>
                        <div class="col-xs-1 wrapper-none spill-dots" title="{{detailInfo.borrowedAmount}}">
                            {{detailInfo.borrowedAmount||'-'}}
                        </div>
                        <label ng-if="detailInfo.borrowedAmount" class="col-xs-1 m-b-n text-right max-w-100" style="width:25px;">元</label>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 m-b-n text-right max-w-100">剩余额度：</label>
                        <div class="col-xs-1 wrapper-none spill-dots" title="{{detailInfo.surplusQuota}}">
                            {{detailInfo.surplusQuota||'-'}}
                        </div>
                        <label ng-if="detailInfo.surplusQuota" class="col-xs-1 m-b-n text-right max-w-100" style="width:25px;">元</label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-2 control-label"><i>*</i>欠款额度：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="arrears" class="form-control" ng-model="detailInfo.arrears" required
                                   yb-focus yb-focus  yb-number-input disable-decimal="false" decimal-places="2"
                                   max="9999999.99">
                        </div>
                        <label class="col-xs-1 control-label" style="width:25px;">元</label>
                        <div class="col-xs-4 msg-block" style="margin-left: 142px;"
                             ng-show="form.arrears.$invalid && submitted">
                            <div class="error-msg" ng-if="!form.arrears.focused">
                                <i class="yb-icon ico-times-circular"></i>必填项，请填写
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-2 m-b-n text-right max-w-100">待回款金额：</label>
                        <div class="col-xs-1 wrapper-none spill-dots" title="{{detailInfo.pendingPayment}}">
                            {{detailInfo.pendingPayment||'-'}}
                        </div>
                        <label ng-if="detailInfo.pendingPayment" class="col-xs-1 m-b-n text-right max-w-100" style="width:25px;">元</label>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 m-b-n text-right max-w-100">剩余额度：</label>
                        <div class="col-xs-1 wrapper-none spill-dots" title="{{detailInfo.surplusArrears}}">
                            {{detailInfo.surplusArrears||'-'}}
                        </div>
                        <label ng-if="detailInfo.surplusArrears" class="col-xs-1 m-b-n text-right max-w-100" style="width:25px;">元</label>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="loginName" class="form-control" ng-model="detailInfo.remark" maxlength="20">
                        </div>
                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)">保存</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
            </div>
        </div>
    </div>
</div>